﻿using DapperExtensions.Mapper;
using Newtonsoft.Json;

namespace ZilLion.Service.ZilLionOss.Domain.Entitys
{
    /// <summary>
    ///     用户信息
    /// </summary>
    public class OssUserInfoEntity
    {
        [JsonProperty("username")]
        public string UserName { get; set; }

        [JsonProperty("userid")]
        public long UserId { get; set; }

        [JsonProperty("userphoneno")]
        public long UserPhoneNo { get; set; }

        [JsonProperty("useravatar")]
        public string UserAvatar { get; set; }

        [JsonProperty("usernickname")]
        public string UserNickName { get; set; }


        [JsonProperty("zlcompanykey")]
        public string ZlCompanyKey { get; set; }
    }

    public class OssUserInfoEntityMapper : ClassMapper<OssUserInfoEntity>
    {
        public OssUserInfoEntityMapper()
        {
            Table("oss_user_info");
            Map(f => f.UserName).Column("username");
            Map(f => f.UserId).Column("userid").Key(KeyType.Assigned);
            Map(f => f.UserAvatar).Column("useravatar");
            Map(f => f.UserNickName).Column("usernickname");
            Map(f => f.UserPhoneNo).Column("userphoneno");
            Map(f => f.ZlCompanyKey).Column("zlcompanykey");
        }
    }
}